/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
/**
 * This example shows how the redirection-system in GIMI works.
 */

#include "gimi.h"

int main(void) {
  gimi::GIMI gi;

  // Datatypes that don't have redirections will be sent to the default
  // queue (0).

  // Redirect datatype 100000 to queue 1
  gi.addRedirection(1, 100000);

  // Make a copy of datatype 100001 to queue 1 (messages also go the the default queue)
  // Basically one redirection moves to specified queue, another redirection
  // that matches it's type will make additional copy.
  gi.addRedirection(0, 100001);
  gi.addRedirection(1, 100001);

  // Redirects datatype 100002:0 from sender "sendername" to queue 3
  gi.addRedirection(3, 100002, 0);

  // Redirect and copy datatype 100003 to queues 5 and 6, those messages won't
  // show up in the default-queue.
  gi.addRedirection(5, 100003);
  gi.addRedirection(6, 100003);

  return 0;
}
